package cc.shacocloud.luanniao.core.model.po

import cc.shacocloud.luanniao.core.model.constant.DatasetsSegmentStatusEnum
import cc.shacocloud.luanniao.core.model.constant.DatasetsSegmentTypeEnum
import org.springframework.data.relational.core.mapping.Column
import org.springframework.data.relational.core.mapping.Table

/**
 * 数据集的段内容
 *
 * @author 思追(shaco)
 */
@Table("def_datasets_segment")
data class DatasetsSegmentPo(

    /**
     * 数据集id
     */
    @Column("datasets_id")
    val datasetsId: Long,

    /**
     * 数据集类型
     */
    @Column("type")
    val type: DatasetsSegmentTypeEnum,

    /**
     * 引用的索引段落id
     */
    @Column("ref_index_segment_id")
    val refIndexSegmentId: Long? = null,

    /**
     * 内容
     */
    @Column("content")
    val content: String,

    /**
     * 字数
     */
    @Column("word_count")
    val wordCount: Int,

    /**
     * 状态
     */
    @Column("status")
    var status: DatasetsSegmentStatusEnum,

    /**
     * 命中次数
     */
    @Column("hit_count")
    var hitCount: Int,
) : BasePo()
